package com.stylefeng.guns.modular.pay.model;

import com.baomidou.mybatisplus.enums.IdType;
import com.google.common.base.Strings;
import com.stylefeng.guns.modular.pay.util.HideDataUtil;

import java.util.Date;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableName;

import java.beans.Transient;
import java.io.Serializable;

/**
 * <p>
 * 佳付通商户注册
 * </p>
 *
 * @author stylefeng
 * @since 2018-08-17
 */
@TableName("pay_mch_reg")
public class MchReg extends Model<MchReg> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    @TableField("mch_no")
    private String mchNo;
    /**
     * 商户编号
     */
    @TableField("mer_code")
    private String merCode;
    /**
     * 平台商户编码
     */
    @TableField("plat_mer_code")
    private String platMerCode;
    /**
     * 渠道商户编码
     */
    @TableField("ch_mer_code")
    private String chMerCode;
    /**
     * 商户名称
     */
    @TableField("mer_name")
    private String merName;
    /**
     * 真实姓名
     */
    @TableField("real_name")
    private String realName;
    /**
     * 省份编码
     */
    @TableField("province_code")
    private String provinceCode;
    /**
     * 城市编码
     */
    @TableField("city_code")
    private String cityCode;
    /**
     * 商户详细地址
     */
    @TableField("mer_address")
    private String merAddress;
    /**
     * 身份证号码
     */
    @TableField("id_card")
    private String idCard;
    /**
     * 手机号
     */
    private String mobile;
    /**
     * 结算户名
     */
    @TableField("account_name")
    private String accountName;
    /**
     * 结算账号
     */
    @TableField("account_no")
    private String accountNo;
    /**
     * 结算卡预留手
     */
    @TableField("reserved_mobile")
    private String reservedMobile;
    /**
     * 银行名称
     */
    @TableField("bank_name")
    private String bankName;
    /**
     * 银行编号
     */
    @TableField("bank_code")
    private String bankCode;
    /**
     * 开户省份编码
     */
    @TableField("open_province")
    private String openProvince;
    /**
     * 开户城市编码
     */
    @TableField("open_city")
    private String openCity;
    /**
     * 联行号
     */
    @TableField("sub_bank_code")
    private String subBankCode;
    /**
     * 状态(0-未注册 1-成功 2失败)
     */
    private Integer status;
    @TableField("res_code")
    private String resCode;
    @TableField("res_msg")
    private String resMsg;
    /**
     * 是否加入黑名单（0-否 1-是）
     */
    @TableField("is_black")
    private Integer isBlack;
    /**
     * 创建时间
     */
    @TableField("create_time")
    private Date createTime;
    /**
     * 更新时间
     */
    @TableField("update_time")
    private Date updateTime;


    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getMchNo() {
        return mchNo;
    }

    public void setMchNo(String mchNo) {
        this.mchNo = mchNo;
    }

    public String getMerCode() {
        return merCode;
    }

    public void setMerCode(String merCode) {
        this.merCode = merCode;
    }

    public String getPlatMerCode() {
        return platMerCode;
    }

    public void setPlatMerCode(String platMerCode) {
        this.platMerCode = platMerCode;
    }

    public String getChMerCode() {
        return chMerCode;
    }

    public void setChMerCode(String chMerCode) {
        this.chMerCode = chMerCode;
    }

    public String getMerName() {
        return merName;
    }

    public void setMerName(String merName) {
        this.merName = merName;
    }

    public String getRealName() {
        return realName;
    }

    public void setRealName(String realName) {
        this.realName = realName;
    }

    public String getProvinceCode() {
        return provinceCode;
    }

    public void setProvinceCode(String provinceCode) {
        this.provinceCode = provinceCode;
    }

    public String getCityCode() {
        return cityCode;
    }

    public void setCityCode(String cityCode) {
        this.cityCode = cityCode;
    }

    public String getMerAddress() {
        return merAddress;
    }

    public void setMerAddress(String merAddress) {
        this.merAddress = merAddress;
    }

    public String getIdCard() {
        return idCard;
    }
    
    public String getHideIdCard() {
    	if(!Strings.isNullOrEmpty(idCard)){
    		return HideDataUtil.hideCardNo(idCard);
    	}
        return idCard;
    }

    public void setIdCard(String idCard) {
        this.idCard = idCard;
    }

    public String getMobile() {
        return mobile;
    }
    
    public String getHideMobile() {
    	if(!Strings.isNullOrEmpty(mobile)){
    		return HideDataUtil.hidePhoneNo(mobile);
    	}
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public String getAccountName() {
        return accountName;
    }

    public void setAccountName(String accountName) {
        this.accountName = accountName;
    }

    public String getAccountNo() {
        return accountNo;
    }
    
    public String getHideAccountNo() {
    	if(!Strings.isNullOrEmpty(accountNo)){
    		return HideDataUtil.hideCardNo(accountNo);
    	}
        return accountNo;
    }

    public void setAccountNo(String accountNo) {
        this.accountNo = accountNo;
    }

    public String getReservedMobile() {
        return reservedMobile;
    }

    public void setReservedMobile(String reservedMobile) {
        this.reservedMobile = reservedMobile;
    }

    public String getBankName() {
        return bankName;
    }

    public void setBankName(String bankName) {
        this.bankName = bankName;
    }

    public String getBankCode() {
        return bankCode;
    }

    public void setBankCode(String bankCode) {
        this.bankCode = bankCode;
    }

    public String getOpenProvince() {
        return openProvince;
    }

    public void setOpenProvince(String openProvince) {
        this.openProvince = openProvince;
    }

    public String getOpenCity() {
        return openCity;
    }

    public void setOpenCity(String openCity) {
        this.openCity = openCity;
    }

    public String getSubBankCode() {
        return subBankCode;
    }

    public void setSubBankCode(String subBankCode) {
        this.subBankCode = subBankCode;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getResCode() {
        return resCode;
    }

    public void setResCode(String resCode) {
        this.resCode = resCode;
    }

    public String getResMsg() {
        return resMsg;
    }

    public void setResMsg(String resMsg) {
        this.resMsg = resMsg;
    }

    

    public Integer getIsBlack() {
		return isBlack;
	}

	public void setIsBlack(Integer isBlack) {
		this.isBlack = isBlack;
	}

	public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    @Override
    protected Serializable pkVal() {
        return this.id;
    }
    

    @Override
    public String toString() {
        return "MchReg{" +
        "id=" + id +
        ", mchNo=" + mchNo +
        ", merCode=" + merCode +
        ", platMerCode=" + platMerCode +
        ", chMerCode=" + chMerCode +
        ", merName=" + merName +
        ", realName=" + realName +
        ", provinceCode=" + provinceCode +
        ", cityCode=" + cityCode +
        ", merAddress=" + merAddress +
        ", idCard=" + idCard +
        ", mobile=" + mobile +
        ", accountName=" + accountName +
        ", accountNo=" + accountNo +
        ", reservedMobile=" + reservedMobile +
        ", bankName=" + bankName +
        ", bankCode=" + bankCode +
        ", openProvince=" + openProvince +
        ", openCity=" + openCity +
        ", subBankCode=" + subBankCode +
        ", status=" + status +
        ", resCode=" + resCode +
        ", resMsg=" + resMsg +
        ", isBlack=" + isBlack +
        ", createTime=" + createTime +
        ", updateTime=" + updateTime +
        "}";
    }
}
